<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的第一个jQuery 页面</title>
    <!--引入bootsrap css-->
    <link rel = "stylesheet" type="text/css" href="../lib/bootstrap/css/bootstrap.css">
     <link rel = "stylesheet" type="text/css" href="../lib/easyui/themes/icon.css">
     <link rel = "stylesheet" type="text/css" href="../lib/easyui/themes/bootstrap/easyui.css">
    <!--定义页面样式-->
    <style type="text/css">
      /*body {}background-color:red}*/
        form {color:green}
    </style>
    <!--<meta http-equiv="refresh" content="ajaxdata.json">-->
    <!--引入外部的JS库-->
    <script src="../lib/easyui/jquery.min.js"></script>
    <script  src="../lib/easyui/jquery.easyui.min.js"></script>
    <script src="../lib/easyui/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>

<table class="table table-striped">
    <thead>
    <tr>
        <th>姓名</th>
        <th>年龄</th>
        <th>地址</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr id="1">
        <td>张三1</td>
        <td>20</td>
        <td>湖南</td>
        <td><button id="btn_1" class="btn btn-primary btn-xs">查看</button></td>
        <td><button id="btn2_1" class="btn btn-primary btn-xs">删除</button></td>
    </tr>
    <tr id="2">
        <td>张三2</td>
        <td>22</td>
        <td>湖南2</td>
        <td><button id="btn_2" class="btn btn-primary btn-xs">查看</button></td>
        <td><button id="btn2_2" class="btn btn-danger btn-xs" >删除</button></td>
    </tr>
    <tr id="3">
        <td>张三3</td>
        <td>23</td>
        <td>湖南3</td>
        <td><button id="btn_3" class="btn btn-primary btn-xs">查看</button></td>
        <td><button id="btn2_3" class="btn btn-danger btn-xs">删除</button></td>
    </tr>
    </tbody>
</table>
<script>
    $('button[id^="btn2_"]').on('click',function(e){
        var idno = $(this).attr('id');
        console.log(idno)
        idno = idno.slice(5)
        //alert(idno)
        //$.messager.alert('系统提示','是否删除此行？','warning')
        if (confirm("是否确定删除？")) {
            $('tr#'+idno).hide();
            }
    })
</script>
</body>
</body>
</html>